//
//  ColorDemo.swift
//  SwiftUIDemo
//
//  Created by Tilt Wang on 2025/6/25.
//

import SwiftUI

struct ColorDemo: View {
    @State private var selectedColor: Color = .blue
    var body: some View {
//        ColorPicker("选择颜色", selection: $selectedColor, supportsOpacity: true)
//                        .padding()
        if #available(iOS 15.0, *) {
            RoundedRectangle(cornerRadius: 20) //矩形
                .fill(
                    //                Color.primary
//                    Color(.cyan)
//                    Color(UIColor.secondarySystemBackground)
                    Color("CustomColor")
                )
                .frame(width: 200, height: 100)
//                .shadow(radius: 10)
                .shadow(color: Color("CustomColor").opacity(0.3), radius: 13, x: 0.0, y: 20.0)
        } else {
            // Fallback on earlier versions
        }
    }
}

#Preview {
    ColorDemo()
}
